(function(){
	if(typeof(Pearlsen) === "undefined"){
		Pearlsen = {};
	}
	//标签
	if (typeof(Pearlsen.TAG) === "undefined") {
		Pearlsen.TAG = {};
	}
})();
Pearlsen.TAG.advSearchWindow ={
	search:function(){
		var searchForm = Ext.getCmp(this.initialConfig.searchFormId).getForm();
		var fields = searchForm.getValues();
		var conditions = [];
		for(var key in fields){
			if(!Ext.isEmpty(key) && !Ext.isEmpty(fields[key]) && fields.hasOwnProperty(key)) {
			  	var condition=new Condition(key,fields[key]);
			  	conditions.push(condition);
			}
		}
		if( typeof this.initialConfig.searchHandler =='function'){
			var scope = (this.initialConfig.searchHandlerscope ?this.initialConfig.searchHandlerscope:this);
			this.initialConfig.searchHandler.call(scope,conditions);
		}
		this.hide();
	},
	resetForm:function(){
		var searchForm = Ext.getCmp(this.initialConfig.searchFormId).getForm();
		searchForm.reset();
	}
};

